<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="icon" href="/favicion.ico" type="image/ico" />
		<meta content="1 days" name="revisit-after" />
	<meta content="telephone=no" name="format-detection" />
	<meta content="width=device-width" name="viewport" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="false" id="twcClient" name="twcClient" />
		<title>One Page</title>
	<script>var zmdoc = zmdoc||{};</script>
	<!--[if IE]>
	<script type="text/javascript" src="http://html.zmaitech.com/document/common/html5.js"></script>
	<![endif]-->

		
	<script type="text/javascript" src="../common/z.js"></script>

<style type="text/css">
@charset "utf-8";/*ZMAITECH.COM*/	body,	html,        nav,	ol,	th,	embed,	abbr,	li,	input,	gloabl,	h2,	input,		td,	h1,	blockquote,	xml,		div,	dl,	dt,	dd,	ul,		h3,	h4,	h5,	h6,	pre,	form,	fieldset,		p{margin:0;padding:0;}	img,	fieldset, 	body,	html{border:none;}	address,	caption,	cite,	code,	dfn,	em,	strong,	th,	abbr,	var{font-style:normal;font-weight:normal;}	ol,	ul {list-style:none;}	caption,	th {text-align:left;}	h1,h2,h3,h4,h5,h6{font-size:100%;line-height:1}	q:before,q:after{content:'';}	table {border-collapse:collapse;border-spacing:0;}	html {font:12px/150% "Microsoft Yahei","SimSun","Helvetica Neue",Helvetica,Arial,sans-serif; color:#333;background-color: #FFF;}	h1{font-size:100%;}	h2, .h2 {font-size:16px;}	h3, .h3 {font-size:14px;}	h4, .h4 {font-size:12px;}	h5, .h5 {font-size:11px;}	strong {font-weight:bold;}/* ----- core css ------ */

	#wrapper {
		overflow: hidden;
		position: relative;
	}
	#wrapper .inner{
	 -webkit-transition: -webkit-transform 0.8s ease; 
          transition: transform 0.8s ease; 
	}
	#wrapper .page {
		background: red;
		width: 100%;
		height: 500px;
		text-align: center;
		font-size: 30px;
		line-height: 2;
		color: #fff;
		background-repeat:no-repeat;
	background-attachment: local;
	background-position:50% 50%;
	-webkit-background-size: cover;
	}
	#wrapper .dots {
		position: absolute;
		right: 20px;
		width: 10px;
		top: 50%;
	}
	#wrapper .dots li {
		background-color: #666;
		width: 10px;
		height: 10px;
  border-radius: 5px;
  background-clip: padding-box;
  		margin: 10px 0;
  		cursor: pointer;
	}
	#wrapper .dots li:hover,#wrapper .dots li.selected {
		background-color: red;
	}
</style>
</head>
<body class="zm">

<div id="wrapper">
	<div class="inner">
		<div class="page">
			<section>
		<h2>带我们回家吧</h2>
		<p>
			我们的打扮有性感，有可爱，你喜欢什么样的我们呢，或者都喜欢？
		</p>
		<dl>
		<dt><img src="index/assets/product01.jpg" width="363" height="311" /></dt>
		<dd>
			<h3>装性感</h3>
			<p>
				3盒性感装，每盒里5包性感蕾丝文胸款，<br />
				每款性感蕾丝文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	<dl>
		<dt><img src="index/assets/product02.jpg" width="360" height="298" /></dt>
		<dd>
			<h3>装可爱</h3>
			<p>
				3盒可爱装，每盒里5包小熊可爱文胸款，<br />
				每款小熊可爱文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	</section>
		</div>
		<div class="page">
<section>
		<h2>带我们回家吧</h2>
		<p>
			我们的打扮有性感，有可爱，你喜欢什么样的我们呢，或者都喜欢？
		</p>
		<dl>
		<dt><img src="index/assets/product01.jpg" width="363" height="311" /></dt>
		<dd>
			<h3>装性感</h3>
			<p>
				3盒性感装，每盒里5包性感蕾丝文胸款，<br />
				每款性感蕾丝文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	<dl>
		<dt><img src="index/assets/product02.jpg" width="360" height="298" /></dt>
		<dd>
			<h3>装可爱</h3>
			<p>
				3盒可爱装，每盒里5包小熊可爱文胸款，<br />
				每款小熊可爱文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	</section>
		</div>
		<div class="page">
<section>
		<h2>带我们回家吧</h2>
		<p>
			我们的打扮有性感，有可爱，你喜欢什么样的我们呢，或者都喜欢？
		</p>
		<dl>
		<dt><img src="index/assets/product01.jpg" width="363" height="311" /></dt>
		<dd>
			<h3>装性感</h3>
			<p>
				3盒性感装，每盒里5包性感蕾丝文胸款，<br />
				每款性感蕾丝文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	<dl>
		<dt><img src="index/assets/product02.jpg" width="360" height="298" /></dt>
		<dd>
			<h3>装可爱</h3>
			<p>
				3盒可爱装，每盒里5包小熊可爱文胸款，<br />
				每款小熊可爱文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	</section>
		</div>
		<div class="page">
<section>
		<h2>带我们回家吧</h2>
		<p>
			我们的打扮有性感，有可爱，你喜欢什么样的我们呢，或者都喜欢？
		</p>
		<dl>
		<dt><img src="index/assets/product01.jpg" width="363" height="311" /></dt>
		<dd>
			<h3>装性感</h3>
			<p>
				3盒性感装，每盒里5包性感蕾丝文胸款，<br />
				每款性感蕾丝文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	<dl>
		<dt><img src="index/assets/product02.jpg" width="360" height="298" /></dt>
		<dd>
			<h3>装可爱</h3>
			<p>
				3盒可爱装，每盒里5包小熊可爱文胸款，<br />
				每款小熊可爱文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	</section>
		</div>
		<div class="page">
<section>
		<h2>带我们回家吧</h2>
		<p>
			我们的打扮有性感，有可爱，你喜欢什么样的我们呢，或者都喜欢？
		</p>
		<dl>
		<dt><img src="index/assets/product01.jpg" width="363" height="311" /></dt>
		<dd>
			<h3>装性感</h3>
			<p>
				3盒性感装，每盒里5包性感蕾丝文胸款，<br />
				每款性感蕾丝文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	<dl>
		<dt><img src="index/assets/product02.jpg" width="360" height="298" /></dt>
		<dd>
			<h3>装可爱</h3>
			<p>
				3盒可爱装，每盒里5包小熊可爱文胸款，<br />
				每款小熊可爱文胸里是两个我们精心挑选过的两颗枣。
			</p>
			<h2>价格敬请期待</h2>
			<img src="index/assets/qr_product.jpg" width="181" height="203" />
		</dd>
	</dl>
	</section>
		</div>
		<div class="page"></div>
	</div>
</div>

<script type="text/javascript">

$.each($('.page','#wrapper'),function (i,el) {
		// var r = Math.floor(Math.random()*255).toString(16)
		// 	,g = Math.floor(Math.random()*255).toString(16)
		// 	,b = Math.floor(Math.random()*255).toString(16);
		// 	r = ('0'+r).slice(-2);
		// 	g = ('0'+g).slice(-2);
		// 	b = ('0'+b).slice(-2);
		// 	el.html(i);
		// el.css({'background':'#'+r+g+b});
		el.css({'background-image':'url(page0'+(i+1)+'_bg.jpg)'});
	});

$.isMobile = function(){
   	return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}


$.fn.OnePage = function(config) {
	var s = document.createElement('p').style,
			supportsTransitions = 'transition' in s ||
									'WebkitTransition' in s ||
									'MozTransition' in s ||
									'msTransition' in s ||
									'OTransition' in s
			,isTouchWebkit = "ontouchstart" in window && "WebKitCSSMatrix" in window,
			touchstart = "touchstart", touchmove = "touchmove", touchend = "touchend"
			,me = this;
	//config
	config = $.extend({
		scale:1,
		draggable:true,
		moveStart:function(current,prev,wrap) {},
		moveEnd:function(current,prev,wrap) {}
	},config);

	if (config.draggable && !isTouchWebkit) {
		touchstart = "mousedown";
		touchmove = "mousemove";
		touchend = "mouseup";
	};

	var wrap = $('.inner',me)[0],pages = $('.page',me),mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel"
		,inAnim = false,current = 0,prev = 0,count = pages.length
		,x = 0,offset = 0,originX = 0,win = $(window),inTouch = false,time = wrap.css('transition-duration');
	time = typeof(time) == 'undefined' ? 10 : (time.indexOf('ms') > -1 ? parseFloat(time) : (parseFloat(time)*1000));
	me.css({'width':$.winSize(0)/config.scale+'px','height':$.winSize(1)/config.scale+'px'});
	me.css({'overflow':supportsTransitions?'hidden':'auto'});

	var dotwrap = document.createElement('ul');
	if(!supportsTransitions) dotwrap.style.display = 'none';
	me.append(dotwrap);
	dotwrap = $(dotwrap);
	dotwrap.addClass('dots');
	dotwrap.html((new Array(count+1)).join('<li></li>'));
	//dotwrap.css({'margin-top':'-'+dotwrap.zmheight()/2+'px'});
	var dots = $('li',dotwrap);
	dots[0].addClass('selected');
	$.each(dots,function(i,el) {
		el.data('index',i);
		el.on('click',function() {
			me.movePage($(this).data('index'));
		});
	});
	//
	$.each(pages,function (i,el) {
		el.css({'width':$.winSize(0)/config.scale+'px','height':$.winSize(1)/config.scale+'px'});
	});
	//
	$(window).on('resize',function() {
		$.each(pages,function (i,el) {
			el.css({'width':$.winSize(0)/config.scale+'px','height':$.winSize(1)/config.scale+'px'});
		});
		me.css({'width':$.winSize(0)/config.scale+'px','height':$.winSize(1)/config.scale+'px'});
		originX = current*$.winSize(1)/config.scale;
		wrap.css({'transition-duration':0+'ms','transform':'translate3d(0,-'+originX+'px,0)'});
		setTimeout(function() {
			wrap.css({'transition-duration':time+'ms'});
		},50);
	});
	function _moving(onevent) {
		originX = current*$.winSize(1)/config.scale;
		wrap.css({'transform':'translate3d(0,-'+originX+'px,0)'});
		onevent || config.moveStart(current,prev,me);
		dots[prev].removeClass('selected');
		dots[current].addClass('selected');
		setTimeout(function() {
			inAnim = false;
			onevent || config.moveEnd(current,prev,me);
		},time);
	};
	
	this.movePage = function(index) {
		if(index == current) return;
		prev = current;
		current = index;
		_moving();
	};
	this.nextPage = function() {
		prev = current;
		current = Math.min(current+1,count-1);
		_moving();
	};
	this.prevPage = function() {
		prev = current;
		current = Math.max(current-1,0);
		_moving();
	};
	if(supportsTransitions) {
		$(window).on(mousewheelevt,function (e){
			var delta = e.wheelDelta ? (e.wheelDelta / 120) : (- e.detail / 3);
			if(!inAnim && Math.abs(delta) > 0.3) {
				inAnim = true;
				if(delta < 0) {
					me.nextPage();
				} else if(delta>0) {
					me.prevPage();
				}
			}
			e.stopPropagation();
			e.preventDefault();
			});
	};

	me.on(touchstart,function(e){
		e.preventDefault();
		if(inAnim) return;
		inTouch = true;
		x = e.changedTouches && isTouchWebkit ? e.changedTouches[0].pageY:e.pageY;
		wrap.css({'transition-duration':0+'ms'});
	});
	me.on(touchmove,function(e){
		e.preventDefault();
		if(inAnim) return;
		if(!inTouch) return;
		var _x = (e.changedTouches && isTouchWebkit) ? e.changedTouches[0].pageY:e.pageY;
		offset = _x - x;
		x = _x;
		originX -= offset;
		wrap.css({'transform':'translate3d(0,-'+originX+'px,0)'});

	});
	win.on(touchend,function(e){
		e.preventDefault();
		if(inAnim) return;
		inTouch = false;
		var _x = e.changedTouches && isTouchWebkit ? e.changedTouches[0].pageY:e.pageY;
		offset = _x - x;
		x = _x;
		originX -= offset;
		if(Math.abs(originX-current*$.winSize(1)/config.scale) > 100) {
			(originX>current*$.winSize(1)/config.scale) ? me.nextPage() : me.prevPage();
		} else {
			_moving(true);
		}
		wrap.css({'transition-duration':time+'ms'});

	});
	return this;
};

if($.isMobile()) {
	var pageHeight = 960.0,pageWidth = 640.0,scale = $.viewport()[0]/pageWidth;
	var scaleStyle = 'scale('+scale+','+scale+')';

	$('#wrapper').css({
	    'transform': scaleStyle,
	    'transform-origin': '0 0'
	});
	$(function() {
		var height = Math.max(Math.min($.viewport()[1],Math.ceil($.viewport()[1]*scale)),$.winSize(1));
		$(document.body).zmheight(height);
	});
}
console.log($('#wrapper').OnePage);
$('#wrapper').OnePage({scale:scale||1});

</script>

</body>
</html>
